package com.xsystem.user;

import com.xsystem.orm.user.User;
import com.xsystem.user.delegates.UserDelegate;
import com.xsystem.user.exception.UserNotFoundException;
import com.xsystem.user.exception.UserUnauthorizedException;

public class UserEngine {

	private UserDelegate userDelegate;

	// ================================================================================
	// User Operations
	// ================================================================================

	public User getAuthenticatedUser(String username, String hashedPassword)
			throws UserNotFoundException, UserUnauthorizedException {

		return userDelegate.getAuthenticatedUser(username, hashedPassword);
	}
	
	public User createUser(String username, String password){
		return userDelegate.createUser(username, password);
	}

	public UserDelegate getUserDelegate() {
		return userDelegate;
	}

	public void setUserDelegate(UserDelegate userDelegate) {
		this.userDelegate = userDelegate;
	}

}
